package com.tencent.hummingbird.portal.mapper;

import com.tencent.hummingbird.portal.pojo.UserCollect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
* <p>
    *  Mapper 接口
    * </p>
*
* @author yxb
* @since 2024-01-10
*/
@Repository
public interface UserCollectMapper extends BaseMapper<UserCollect> {
    @Delete("DELETE FROM user_collect WHERE user_id = #{userId} AND question_id=#{questionId}")
    Integer deleteCollect(Integer userId,Integer questionId);

    @Select("SELECT COUNT(*) FROM user_collect WHERE user_id = #{userId} AND question_id = #{questionId}")
    Integer selectCollectStatus(UserCollect userCollect);
}
